﻿using System;
using System.Configuration;
using System.Drawing;
using System.Windows.Forms;
using PDChart;

namespace Seagull.Controls
{
    public partial class ChartGroup : UserControl
    {
        private static readonly int _titleFontSize = int.Parse(ConfigurationManager.AppSettings["ChartGroupTitleSize"]);

        public ChartGroup()
        {
            InitializeComponent();
            prpdChart2D1.Title.Font = new Font(FontFamily.GenericSerif, _titleFontSize);
            prpsChart3D1.Title.Font = new Font(FontFamily.GenericSerif, _titleFontSize);

            prpdChart2D1.MaxValue = new XYZ(200, 255, 50);
            prpsChart3D1.MaxValue = new XYZ(50, 200, 1);
        }

        public void Set(double[,] data)
        {
            prpsChart3D1.Set(data);
            prpdChart2D1.Set(data);
        }

        public override string Text
        {
            get { return base.Text; }
            set { prpsChart3D1.Title.Text = prpdChart2D1.Title.Text = base.Text = value; }
        }
    }
}
